from django.db import models

# Create your models here.
class Areas(models.Model):
    name = models.CharField(max_length=20,verbose_name='地区名')
    parent = models.ForeignKey('self',on_delete=models.SET_NULL,verbose_name="上级地区",null=True,related_name='subs',blank=True)

    class Meta:
        db_table = 'tb_areas'
        verbose_name = '行政区划'
        verbose_name_plural = '行政区划'

    def ___str__(self):
        return self.name
